//
//  ServerEngine.h
//  fugitive
//
//  Created by Eugene Bistolas on 5/26/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JSONKit.h"
#import "Player.h"
#import "Powerup.h"
#import "Targets.h"
#import "Definitions.h" 


@interface ServerEngine : NSObject {
    JSONDecoder *decoder; 
}

@property (nonatomic, assign) int playerType; 
@property (nonatomic, assign) int playerID; 
@property (nonatomic, retain) NSString *playerName;
@property (nonatomic, assign) int alertStatus; 

@property (nonatomic, retain) NSMutableArray *players; 
@property (nonatomic, retain) NSMutableArray *powerups;

@property (nonatomic, retain) Targets *startTarget;
@property (nonatomic, retain) Targets *endTarget; 
@property (nonatomic, assign) int endTime; 
@property (nonatomic, assign) int gameInstance; 

@property (nonatomic, assign) int gameRunning; 

- (void) getGameData;
- (void) getInitialGameData; 
-(id) initWithPlayerID:(int) pid playerType:(int) ptype playerName:(NSString*) pname gameInstance:(int)g;
- (void) updatePlayerLocation:(CLLocationCoordinate2D) coord; 
- (void) clearAllServerData; 

+ (int) registerNewPlayerWithName: (NSString*) name type:(int) t gameInst:(int)g; 
+ (void) registerGameInformationWithInstance:(int) gIst endTime:(int) endTime startLocation:(CLLocationCoordinate2D) start stopLocation:(CLLocationCoordinate2D) stop;
+ (void) registerNewPowerupWithGameInstance:(int) ginst name:(NSString*)n type:(int) t location: (CLLocationCoordinate2D) coord;

@end
